package com.example.note.service;

import com.example.note.mapper.NoteInfoMapper;
import com.example.note.model.NoteInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Home-pc
 */
@Service
public class NoteService {

    @Autowired
    private NoteInfoMapper noteInfoMapper;

    public List<NoteInfo> getNoteList(){
        return noteInfoMapper.queryNoteList();
    }

    public NoteInfo getNoteDetail(Integer id){
        return noteInfoMapper.queryById(id);
    }

    public Integer insertNote(NoteInfo noteInfo) {
        return noteInfoMapper.insertNote(noteInfo);
    }

    public Integer updateNote(NoteInfo noteInfo) {
        return noteInfoMapper.updateNote(noteInfo);
    }
}
